home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: given: char foo[80]; there is no such thing as element foo[80] correct? (i.e. foo[80] = '\0' is beyond the array boundary)
- Date: 15 Mar 1996 18:10:07 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Mar15111007@qcd.lanl.gov>
- References: <3148DBB6.1353@hawaii.edu>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: Dave Carien's message of Thu, 14 Mar 1996 18:53:42 -0800
-
- In article <3148DBB6.1353@hawaii.edu>
- Dave Carien <davec@hawaii.edu> writes:
-
- DC: Yes or no on this, I just recently got confused by two different books. I
- DC: assume that the declaration foo[80] allocates storage for elements 0-79.
- DC: A string could be terminated by doing something like foo[79] = '\0', but
- DC: foo[80] = '\0' would be invalid because such an element does not exist.
- DC: Just looking for confirmation that I'm right here. A simple Y or N will
- DC: do thanks.
-
- Yes, you are right.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-